package com.test.webflux.controller;

import com.test.webflux.entity.ResponseResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Mono;

/**
 * 测试controller
 *
 * @Description
 * @Author lingmin
 * @Date 2025/4/14 11:22
 **/
@Slf4j
//@RequestMapping("/user")
//@RestController
public class UserController {


    @GetMapping(value = "/title")
    public Mono<String> getTitle() {
        log.info("title");
        return Mono.just("用户信息");
    }


    @GetMapping(value = "/list", produces = MediaType.APPLICATION_JSON_VALUE)
    public Mono<ResponseResult<String>> list() {
        log.info("users");
        ResponseResult result = new ResponseResult();
        result.setCode("000000");
        result.setMsg("成功");
        result.setData("获取用户信息成功");
        return Mono.just(result);
    }

}
